home *** CD-ROM | disk | FTP | other *** search
- Path: news.spb.su!demos!coin!edisoft!newsserv
- From: Igor Kouznetsov <igor@bnkdp.khabarovsk.su>
- Newsgroups: comp.lang.c
- Subject: Help with writing to stdin (UNIX)
- Date: 21 Mar 1996 06:33:00 +1000
- Organization: unknown
- Sender: newsserv@edisoft.ru
- Distribution: world
- Message-ID: <199603210528.TAA02459@ss20.bnkdp.khabarovsk.su>
- Reply-To: igor@bnkdp.khabarovsk.su
- X-Return-Path: cent.edisoft.ru!bnkdp.khabarovsk.su!ss20.bnkdp.khabarovsk.su!bnkdp!bnkdp.khabarovsk.su!ss20.bnkdp.khabarovsk.su!igor
-
- I create a child process (by fork()) and need to insert some input to
- the stdin (sure, stdin is the same for both parent and child
- processes) in parent, expecting that it will appear in stdin of
- child.
-
- I tried to do that,foe example, by direct writing to buffer
- pointed by according fields of stdin FILE structure, but pointer to
- buffer associated with stdin turns to be NULL, I can't comprehand
- why :-(
-
- I also made some attempts using other methods but they also failed
- for different reasons, so there's no sense to describe that struggle.
-
- A small illustration of the task:
- ---------- ---------
- | Parent | | Child |
- | process | | process |
- -------->|----------|---->| |
- stdin | ^ | | |
- | | | | |
- | some | | |
- | input | | |
- --------- ---------
- Does anybody have any idea how to realize it?
- Note: I need NOT a pipe between processes but a way to insert
- something namely to stdin of child process.
-
- Thanx in advance.
- ====================================================
- Igor Kouznetsov, software engineer
- e-mail: igor@bnkdp.khabarovsk.su
-
-